package com.wayhome.srpingbootmybatis.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan
public class CSPConfig {

    @Value("${cos.accessKey}")
    private String accessKey;

    @Value("${cos.secretKey}")
    private String secretKey;

    @Value("${cos.bucket}")
    private String bucket;

    @Value("${cos.endpoint}")
    private String endpoint;

    @Bean(name = "cspService")
    public CSPService cspService() {
        CSPService cspService = new CSPService(endpoint,accessKey,secretKey);
        return cspService;
    }
}
